<include file="Public:header" />
<body class="gray-bg">
	<script src="__PUBLIC__/Admin/js/upload_picture/uploadPreview.js" type="text/javascript"></script>
    <script>
       window.onload = function () { 
            new uploadPreview({ UpBtn: "up_img", DivShow: "imgdiv", ImgShow: "imgShow" });
        }
    </script>
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-8">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>参数配置</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="dropdown-toggle" data-toggle="dropdown" href="form_basic.html#">
                            <i class="fa fa-wrench"></i>
                        </a>
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content">
                    <form class="form-horizontal m-t" action="{:U('Config/updateConfig')}" id="insertForm" method="post" enctype="multipart/form-data">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">开启注册:</label>
                            <div class="input-group col-sm-4">
                                <input id="id" type="text" class="form-control" value="{$config['CAN_REG']}" name="CAN_REG" required="" aria-required="true">
								<div class="input-group col-sm-12 bg-warning">
									1为开启0为关闭
								</div>
                            </div>
                        </div>
                        <!--<div class="form-group">
                            <label class="col-sm-3 control-label">开启交易挂买:</label>
                            <div class="input-group col-sm-4">
                                <input id="id" type="text" class="form-control" value="{$config['CAN_BUY']}" name="CAN_BUY" required="" aria-required="true">
								<div class="input-group col-sm-12 bg-warning">
									1为开启0为关闭
								</div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">开启交易挂卖:</label>
                            <div class="input-group col-sm-4">
                                <input id="id" type="text" class="form-control" value="{$config['CAN_SELL']}" name="CAN_SELL" required="" aria-required="true">
								<div class="input-group col-sm-12 bg-warning">
									1为开启0为关闭
								</div>
                            </div>
                        </div>-->
                        <div class="form-group">
                            <label class="col-sm-3 control-label">提现最小金额:</label>
                            <div class="input-group col-sm-4">
                                <input id="id" type="text" class="form-control" value="{$config['WITHDRAWALS_MIN']}" name="WITHDRAWALS_MIN" required="" aria-required="true">
								<div class="input-group col-sm-12 bg-warning">
								</div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">提现基数:</label>
                            <div class="input-group col-sm-4">
                                <input id="id" type="text" class="form-control" value="{$config['WITHDRAWALS_NUM_BASE']}" name="WITHDRAWALS_NUM_BASE" required="" aria-required="true">
								<div class="input-group col-sm-12 bg-warning">
								</div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">提现手续费:</label>
                            <div class="input-group col-sm-4">
                                <input id="id" type="text" class="form-control" value="{$config['WITHDRAWALS_FEE']}" name="WITHDRAWALS_FEE" required="" aria-required="true">
								<div class="input-group col-sm-12 bg-warning">
								</div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">收款二维码:</label>
                            <div class="input-group col-sm-4">
                            	<span class="field" id="imgdiv">
						          <img id="imgShow" width="200" height="250" src="{$config['QRCODE']}"/><br><br>
						          <input type="file" id="up_img" name="QRCODE" />
						      </span>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-3">
                                <!--<input type="button" value="提交" class="btn btn-primary" id="postform"/>-->
                                <button class="btn btn-primary" type="button" onclick="toVaild()">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>

        </div>
    </div>
</div>
<include file="Public:footer" />
<script src="__PUBLIC__/Admin/js/jquery.form.min.js"></script>
<script type="text/javascript">
function toVaild(){
	$('#insertForm').ajaxSubmit(function(data){
                if(data['status'] == true){
                    swal(data.info, "", "success");
                }else{
                    swal(data.info, "", "error");
                }
	});
}
    //表单提交
    function toVaild1(){
        var jz;
        var url = "{:U('Config/updateConfig')}";
        $.ajax({
            type:"POST",
            url:url, 
            data: $('#insertForm').serialize(),// 你的formid
            async: false,
            beforeSend:function(){
                jz = layer.load(0, {shade: false}); //0代表加载的风格，支持0-2
            },
            error: function(request) {
                layer.close(jz);
                swal("网络错误!", "", "error");
            },
            success: function(data) {
                //关闭加载层
                layer.close(jz);
                if(data['status'] == true){
                    swal(data.info, "", "success");
                }else{
                    swal(data.info, "", "error");
                }

            }
        });

        return false;
    }

</script>
</body>
</html>